package com.woniuxy.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


import java.io.Serializable;

/**
 * @Author: 马宇航
 * @Todo: 利用jpa来进行操作
 * @DateTime: 25/01/02/0002 15:30
 * @Component: 成都蜗牛学苑
 **/
//Entity可以根据下面的实体类，自动生成数据库的表单  jpa的功能：hibernate的规范化实现方案。完全的ORM（对象关系映射）框架
@Entity(name = "myh_user")
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class User implements Serializable {
    @Id  //表示uid是主键
    @GeneratedValue(strategy = GenerationType.IDENTITY) //表示主键自增
    private Integer uid;
    String username;
    String password;
    String telphone;
}